package com.seanchenxi.gwt.wordpress.xmlrpc.service;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.seanchenxi.gwt.wordpress.domain.model.Blog;
import com.seanchenxi.gwt.wordpress.domain.model.Post;
import com.seanchenxi.gwt.wordpress.domain.model.UserInfo;

/**
 * The Interface BloggerService.
 */
public interface BloggerServiceAsync {

	/**
	 * Retrieve the blogs of the users.
	 * 
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param callback
	 *            the asynchronous call back
	 * @return the user's blogs
	 */
	void getUsersBlogs(String username, String password,
			AsyncCallback<ArrayList<Blog>> callback);

	/**
	 * Gets the user info.
	 * 
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param callback
	 *            the asynchronous call back
	 * @return the user info
	 */
	void getUserInfo(String username, String password,
			AsyncCallback<ArrayList<UserInfo>> callback);

	/**
	 * Gets the post.
	 * 
	 * @param postId
	 *            the post id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param callback
	 *            the asynchronous call back
	 * @return the post
	 */
	void getPost(int postId, String username, String password,
			AsyncCallback<Post> callback);

	/**
	 * Gets the recent posts.
	 * 
	 * @param blogId
	 *            the blog id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param number
	 *            the number
	 * @param callback
	 *            the asynchronous call back
	 * @return the recent posts
	 */
	void getRecentPosts(int blogId, String username, String password,
			int number, AsyncCallback<ArrayList<Post>> callback);

	/**
	 * Gets the template.
	 * 
	 * @param blogId
	 *            the blog id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param callback
	 *            the asynchronous call back
	 * @return the template content
	 */
	void getTemplate(int blogId, String username, String password,
			AsyncCallback<String> callback);

	/**
	 * Sets the template.
	 * 
	 * @param blogId
	 *            the blog id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param content
	 *            the content
	 * @param callback
	 *            the asynchronous call back
	 * @return true if the template was configured
	 */
	void setTemplate(int blogId, String username, String password,
			String content, AsyncCallback<Boolean> callback);

	/**
	 * Delete post.
	 * 
	 * @param postId
	 *            the post id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param callback
	 *            the asynchronous call back
	 * @return true if the post was deleted
	 */
	void deletePost(int postId, String username, String password,
			AsyncCallback<Boolean> callback);

	// /**
	// * New post.
	// */
	// void newPost();
	//
	// /**
	// * Edits the post.
	// */
	// void editPost();
}
